* {
    margin: 0;
    padding: 0;
}
body {
    height: 100vh;
    background-color: #333;
}

.container {
    width: 15px;
    height: 600px;
    //绝对固定定位
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #222;
    border-radius: 0 15px 15px 0;
    overflow: hidden;
    transition: 0.3s;
    &:hover {
        width: 130px;
        border-radius: 0 30px 30px 0;
        li a {
            color: #fff;
        }
    }
    &::before {
        content: '';
        width: 50%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
        background-color: lightseagreen;
    }
    .top {
        width: calc(100% - 30px);
        margin-left: 30px;
        height: 20%;
        background-color: #222;
        border-radius: 0 0 0 20px;
        transition: 0.3s;
    }
    .middle {
        width: calc(100% - 60px);
        height: 10%;
        background-color: lightseagreen;
        margin-left: 40px;
        border-radius: 20px;
    }
    .bottom {
        width: calc(100% - 30px);
        margin-left: 30px;
        height: 100%;
        background-color: #222;
        border-radius: 20px 0 0 0;
    }

    li {
        position: absolute;
        width: 100%;
        height: 10%;
        font-size: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        @for $i from 1 to 7 {
            &:nth-child(#{$i}) {
                top: 10% + $i * 10%;
                &:hover ~ .top {
                    height: 10% + $i * 10%;
                }
            }
        }
        a {
            color: transparent;
            transition: 0.3s;
        }
    }
}
